import React from 'react';
import Header from './common/header/index'
import Login from './pages/login/index'
import store from './store/index'
import {
  BrowserRouter as Router,
  Switch,
  Route,
  Link
} from "react-router-dom";

import {Provider} from 'react-redux'
import Home from './pages/home/index'
import Detail from './pages/detail/loadable'

function App() {
  return (
    <Provider store={store}>
      <>
        <Router>
          <Header/>
          <Switch>
            {/* <Route path='/' exact render={()=><div>home</div>}></Route> */}
            {/* <Route path='/detail' exact render={()=><div>detail</div>}></Route> */}
            <Route path='/' exact component={Home}></Route>
            <Route path='/login' exact component={Login}></Route>
            <Route path='/detail/:id' exact component={Detail}></Route>
          </Switch>
        </Router>
      </>
    </Provider>
  );
}

export default App;
